package com.naihe.anderson.sms.adapter;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.TextView;

import com.naihe.anderson.sms.R;


public class MoneySetAdapter  extends BaseAdapter{
    Context mContext;
    List<String> setList;

    public MoneySetAdapter(Context context ,List<String> objects) {
        this.mContext = context;
        this.setList = objects;
    }

    @Override
    public int getCount() {
    	if(setList == null)return 0;
        return setList.size();
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
    	
        //View view = updateViewItemStatus(entity);
        View view = null;
        if (convertView == null) {
            LayoutInflater inflater = LayoutInflater.from(mContext);
            view = inflater.inflate(R.layout.base_set_item, null);
        } else {
            view = convertView;
        }
        
        String baseName = setList.get(position);

        TextView invitefriendName = (TextView) view.findViewById(R.id.baseName);
        invitefriendName.setText(baseName);

        CheckBox widgetCheckbox = (CheckBox) view.findViewById(R.id.widget_checkbox);
        
        return view;
    }
    
	@Override
	public Object getItem(int position) {
		if(setList == null)return null;
        return setList.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

}
